import { Flex } from 'antd-mobile';
import React, { Component } from 'react';
import SearchHeader from '../../components/SearchHeader';
import Sticky from '../../components/Sticky';
import { getLocation } from '../../utils';
import Filter from './components/Filter/index';
import styles from './index.module.scss';

export default class Rent extends Component {

  state = {
    cityInfo: {}
  };


  async componentDidMount() {
    const res = await getLocation();
    this.setState({
      cityInfo: res
    });
  }
  render() {

    return (
      <div>

        <Flex className={styles.heander}>
          <i className="iconfont icon-back" onClick={() => this.props.history.go(-1)}></i>
          <SearchHeader className={styles.searchHeader} cityName={this.state.cityInfo.label}></SearchHeader>
        </Flex>

        <Sticky>
          <Filter></Filter>
        </Sticky>

      </div>
    );
  }
}
